<template>
  <div class="app">
    <h1>app</h1>
    <input
      type="text"
      v-model="msg"
    />
    <!-- <Child
      :msg="msg"
      @change="(data) => (msg = data)"
    ></Child> -->

    <!-- <Child
      :msg="msg"
      @update:msg="(data) => (msg = data)"
    ></Child> -->
    <!-- 2.3+ 写法，但是在vue3中已经丢弃
    <Child :msg.sync="msg"></Child> -->
    <Child v-model:msg="msg"></Child>
  </div>
</template>
<script>
import Child from './Child.vue'
export default {
  components: {
    Child
  },
  data() {
    return {
      msg: '父组件'
    }
  }
}
</script>
<style lang="scss" scoped></style>
